import { ElMessage } from "element-plus"
import router from "./router"
import { userPinna } from "./store/user"
const WHITE_LIST=['/login','/404']
router.beforeEach((to,from,next)=>{
const store= userPinna()
if(store.token){
  next()
}else{
  if(WHITE_LIST.includes(to.path)){
    next()
  }else{
    ElMessage.warning('请先登录')
    next('/login')
  }
}
})